package ee.greaton.siteManager.GUI;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class MainMenuGUI extends Thread {

	public MainMenuGUI() {
		start();
	}

	public void run() {
		JFrame frame = new JFrame();
		frame.setTitle("Site Manager");
		frame.setSize(100, 200);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JPanel panel = new JPanel();
		JButton btn1 = new JButton();
		JButton btn2 = new JButton();
		btn1.setText("Lisa uus sait");
		btn1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				new AddNewGUI(null);
			}
		});
		btn2.setText("Halda saite");
		btn2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				new ManageSitesGUI().setVisible(true);
			}
		});
		panel.add(btn1);
		panel.add(btn2);
		frame.add(panel);
		frame.setVisible(true);
	}
}
